<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>作用域</title>
</head>
<body>
		<script>
			var color = "blue";

			function changeColor() {
				if (color ==="blue") {
					color = "red";
				} else{
					color = "blue";
				}
			}

			changeColor();

			alert("Color is now" + color);
		</script>
</body>
</html>